﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Cofe.Core;
using Cofe.Web.Models;
using Cofe.Web.Utils;

namespace Cofe.Web.Controllers
{
    [Authorize]
    public class EntryController : Controller
    {
        //
        // GET: /Entry/
        public ActionResult Parse(string path)
        {
            var foundEntry = EntryFE.TryParsePathAsync(path).Result;
            if (foundEntry != null)
                return View(EntryViewModel.FromEntry(foundEntry));
            else return HttpNotFound();
        }

        public ActionResult Index()
        {
            return View();
        }

    }
}
